package com.heyun.mapper;

import com.heyun.entity.pojo.Grades;
import com.heyun.entity.pojo.CheckPOJO;
//import com.heyun.entity.pojo.SubjectPOJO;
import com.heyun.entity.vo.Homework;
import com.heyun.entity.vo.SignIn;
import com.heyun.entity.vo.StudentOfClass;
import com.heyun.entity.vo.SubjectVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface TeacherMapper {
    StudentOfClass[] getStudentByClass(@Param("classId") String classId); // 获取学生信息
    Grades[] getStudentsGrades(@Param("classId") String classId);// 获取学生成绩
    int pubHomeworks(@Param("homework") Homework homework);// 发布平时作业
    int pubSigns(@Param("signs")SignIn signs);  //发布签到
    int updateTotalPoints(@Param("signs")SignIn signs, @Param("points") double points); // 发布签到同时加积分
    int updateLog(@Param("signs")SignIn signs); // 发布签到同时加积分
    int updatePoints(@Param("signs")SignIn signs, @Param("points") double points);
    @Select("select teacher_id,homework_id,tb_subject.subject_id,subject_name from tb_subject,tb_homework where tb_subject.subject_id = tb_homework.subject_id and teacher_id = #{userId}")
    CheckPOJO[] getCheckPOJOsOfTeacher(@Param("userId") String teacherId);  // 获取教师负责的科目
    Homework[] getHomeworkOfTeacher(@Param("userId") String userId);// 获取学生的平时作业信息
    int CommentStudentHomework(@Param("homework") Homework homework ); // 评价学生的平时作业
    SignIn[] getSignInStudent(@Param("subjectId") String subjectId);
    int changeHomework(@Param("expId") String expId , @Param("fileCompletePath") String fileCompletePath);
    int addPoint(@Param("subjectId") String subjectId, @Param("userId") String userId , @Param("points") double points);
    SubjectVO[] getSubjects(@Param("userId") String userId);
    int changeWeight(@Param("subject") SubjectVO subjectVO);
    int cancleSignIns(@Param("subjectId") String subjectId);
}
